﻿/**
*预审回复
*/
Chenxin.UI.ReplyPreForm = Chenxin.extend(Chenxin.UI.FormCommon, {
    actionUrl: '/service/logic/ShowListPreliminary.ashx',
    id: 'ReplyPre',
    renderTo: 'divReplyPre',
    title: '预审回复',
    jqmWidth: 650,
    defBBtn:true,
    createForm: function() {
        return Chenxin.FormCommon.ReplyPreForm(this.id);
    },
    createGrid:function(){
        return new Chenxin.UI.JsonGrid({
            actionUrl: this.actionUrl + '?op=searchCustomer',
            id: 'Customer_grid',
            renderTo: this.id+'_grid',
            hasCheckBox:true,
            cellBorder:true,
            scope:this,
			autoLoad:false,
			pageSize:3,
			exportAble:false,
			hasCheckBox:false,
            columns: {
                CustomerName: {
                    head: '贷款人',
                    width: 70
                },
                IDNum: {
                    head: '贷款人身份证',
                    width: 140
                },
                GJJNum: {
                    head: '公积金账户',
                    width: 90
                },
                SpousesName: {
                    head: '配偶姓名',
                    width: 70
                },
                SpousesIDNum: {
                    head: '配偶身份证',
                    width: 140
                },
                SpousesGJJNum: {
                    head: '配偶公积金账户',
                    width: 90
                }
            }
        });
	},
//	initFormValidator:function(){
//        //评估价
////        $("#txtEstimatePrice").formValidator({
////            validatorgroup: this.id,
////            onshow: "请输入评估价！",
////            onfocus: "单位：万元",
////            oncorrect: " "
////        }).inputValidator({ 
////            min: 1,
////            empty: {
////                leftempty: false,
////                rightempty: false,
////                emptyerror: "评估价不能为空！"
////            },
////            onerror: "评估价不能为空！"
////        });
//        //预审意见
//        $("#ReplyAdivce").formValidator({
//            validatorgroup: this.id,
//            onshow: "请输入预审意见！",
//            onfocus: "预审意见为必输项",
//            oncorrect: " "
//        }).inputValidator({ 
//            min: 1,
//            empty: {
//                leftempty: false,
//                rightempty: false,
//                emptyerror: "预审意见不能为空！"
//            },
//            onerror: "预审意见不能为空！"
//        });
//    },
    initEvent: function() {
	    $("input[name='EstimatePrice']").keydown(function (event) {
            if (((event.keyCode > 47) && (event.keyCode < 58)) || 
                  ((event.keyCode > 95) && (event.keyCode < 106)) ||
                  (event.keyCode == 110) || (event.keyCode == 8) ||   
                  (event.keyCode == 190)) {
                return true;
            } else {
                return false;
            }      
        });
        $("input[name='GJJmoney']").keydown(function (event) {
            if (((event.keyCode > 47) && (event.keyCode < 58)) || 
                  ((event.keyCode > 95) && (event.keyCode < 106)) ||
                  (event.keyCode == 110) || (event.keyCode == 8) ||   
                  (event.keyCode == 190)) {
                return true;
            } else {
                return false;
            }      
        });
        $("input[name='SYMoney']").keydown(function (event) {
            if (((event.keyCode > 47) && (event.keyCode < 58)) || 
                  ((event.keyCode > 95) && (event.keyCode < 106)) ||
                  (event.keyCode == 110) || (event.keyCode == 8) ||   
                  (event.keyCode == 190)) {
                return true;
            } else {
                return false;
            }
        });
    },
    createComboList:function(){
        //建议银行
        var comboProposeBank= new Chenxin.UI.Combo({
            containerId: '#ProposeBank',
            name: 'ProposeBank',
            required:false,
            tbxWidth: 120,
            colWidth:80,
            items:comboCommon.BankInfo
        });
        return [comboProposeBank];
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.ReplyPreForm.superclass.initComponent.call(this);
        this.grid=this.createGrid();
    }
});

Chenxin.FormCommon.ReplyPreForm=function(formID){
//	return '<table class="tbl_f"><tr><th style="width:105px; height:26px;">房源编号：</th><td><input name="HouseCode" class="inputbox_n fl" type="text" readonly="readonly" style="width:160px;"/></td></tr><tr><th>房源地址：</th><td><input name="Address" class="inputbox_n fl" type="text" readonly="readonly" style="width:160px;"/></td></tr><tr><th>评估价：</th><td><input id="txtEstimatePrice" name="EstimatePrice" class="inputbox_n fl" type="text" style="width:150px;ime-mode:disabled;"/><div id="txtEstimatePriceTip" style="float: left; margin-left: 5px; height: 26px; line-height: 26px; text-align: left;" class="fl"></div></td></tr><tr><th>建议银行：</th><td><div id="ProposeBank"style="z-index:3; margin-right: 2px;" class="SelectWrapSingle"></div></td></tr><tr><th>公积金贷款金额：</th><td><input name="GJJmoney" class="inputbox_n fl" type="text" style="width:150px;ime-mode:disabled;"/>万元</td></tr><tr><th>年限：</th><td><input name="GJJyear" class="inputbox_n fl" type="text" maxlength="30" style="width:150px;"/>年</td></tr><tr><th>商业贷款金额：</th><td><input name="SYMoney" class="inputbox_n fl" type="text" style="width:150px;ime-mode:disabled;"/>万元</td></tr><tr><th>年限：</th><td><input name="SYYear" class="inputbox_n fl" type="text" maxlength="30" style="width:150px;"/>年</td></tr><tr><th>预审意见：</th><td><input id="ReplyAdivce" name="ReplyAdivce" class="inputbox_n fl" style=" width: 470px;"/></td></tr><tr><td colspan="2" ><input type="hidden"  name="RecordId" /></td></tr></table>';
	return '<table class="tbl_f"><tr><th style="width:105px; height:26px;">房源编号：</th><td><input name="HouseCode" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td><th>房源地址：</th><td><input name="Address" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td></tr><tr><th>建筑面积：</th><td><input name="BuildingArea" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td><th>建筑类型：</th><td><input name="BuildingType" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td></tr><th>竣工日期：</th><td><input name="CompleteYear" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td><th>总楼层：</th><td><input name="Total_Floor" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td></tr><tr><th>成交总价：</th><td><input name="SalePrice_T" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/>万元</td><th>贷款总额：</th><td><input name="LoanTotalMoney" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/>万元</td></tr><tr><th>评估价：</th><td><input id="txtEstimatePrice" name="EstimatePrice" class="inputbox_n fl" type="text" style="width:150px;ime-mode:disabled;"/>万元</td><th>建议银行：</th><td><div id="ProposeBank"style="z-index:3; margin-right: 2px;" class="SelectWrapSingle"></div></td></tr><tr><th>公积金贷款金额：</th><td><input name="GJJmoney" class="inputbox_n fl" type="text" style="width:150px;ime-mode:disabled;"/>万元</td><th>年限：</th><td><input name="GJJyear" class="inputbox_n fl" type="text" maxlength="30" style="width:150px;"/>年</td></tr><tr><th>商业贷款金额：</th><td><input name="SYMoney" class="inputbox_n fl" type="text" style="width:150px;ime-mode:disabled;"/>万元</td><th>年限：</th><td><input name="SYYear" class="inputbox_n fl" type="text" maxlength="30" style="width:150px;"/>年</td></tr><tr><th>预审意见：</th><td colspan="3"><textarea id="ReplyAdivce" name="ReplyAdivce" class="textarea_n" style=" float:left; width: 470px; height: 50px; padding:5px;"/></td></tr><tr><td colspan="2" ><input type="hidden"  name="RecordId" /></td></tr></table><div id="'+formID+'_grid"></div>';
};